﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class ScrollBar : Form
    {
        public ScrollBar(String name, int maxValue)
        {
            
            InitializeComponent();
            Text = name;
            trackBar1.SetRange(0,maxValue);
        }

        private void trackBar1_Scroll(object sender, EventArgs e)
        {
            textBox1.Text= trackBar1.Value.ToString();
        }
        public int TheValue
        {

            get { return Int32.Parse(textBox1.Text); }
        }

        private void ScrollBar_Load(object sender, EventArgs e)
        {

        }
    }
}
